-- GENERATED SPELL FOR [Jugkar Grim'rod] --


function spell0_5771(pUnit, Event) --@Curse of Weakness,Self--
pUnit:FullCastSpellOnTarget(12741,pUnit)
pUnit:RegisterEvent('Sorts_5771', 613, 1)
end

function spell1_5771(pUnit, Event) --@Immolate,n/a--
pUnit:FullCastSpellOnTarget(20787,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5771', 23000, 1)
end

function spell2_5771(pUnit, Event) --@Shadow Bolt,n/a--
pUnit:FullCastSpellOnTarget(12471,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5771', 3000, 1)
end

function Sorts_5771(pUnit, Event)
local choix_sorts_5771 = math.random(0, 2)
if choix_sorts_5771 == 0 then
pUnit:RegisterEvent('spell0_5771', 1, 1)
end
if choix_sorts_5771 == 1 then
pUnit:RegisterEvent('spell1_5771', 1, 1)
end
if choix_sorts_5771 == 2 then
pUnit:RegisterEvent('spell2_5771', 1, 1)
end
end

function mob5771_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_5771', math.random(1500, 3000), 1)
end

function mob5771_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5771_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5771_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(5771, 1, 'mob5771_Action')
RegisterUnitEvent(5771, 2, 'mob5771_Leave')
RegisterUnitEvent(5771, 3, 'mob5771_Kill')
RegisterUnitEvent(5771, 4, 'mob5771_Die')
